package com.example.demo.dao

import com.example.demo.bean.UserBean
import org.springframework.stereotype.Repository
import javax.annotation.Resource

@Repository
open class UserDaoImpl : UserDao {

    @Resource
    private lateinit var loginMapper : UserMapper

    //登录
    override fun login(username: String, pwd: String): UserBean? {

        var userBean:UserBean? = null

        userBean = loginMapper.login(username, pwd)

        return userBean
    }
    //注册
    override fun register(username: String, pwd: String,phone:String): Boolean? {

        return loginMapper.register(username, pwd,phone)

    }

    override fun delete(username: String): Boolean? {
        return loginMapper.delete(username)
    }

    override fun update(phone: String): Boolean? {
        return loginMapper.update(phone)
        TODO("Not yet implemented")
    }

}